package com.un.ebs.product.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.un.ebs.product.domain.ProductSaleClass;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * (ProductSaleClass)表数据库访问层
 *
 * @author liubo
 * @since 2020-11-07 21:18:21
 */
public interface ProductSaleClassMapper extends BaseMapper<ProductSaleClass> {

    @Select("select isnull(max(sort)+1,1) from tb_product_sale_class")
    int maxSort();

    @Select("select isnull(max(sort)+1,1) from tb_product_sale_class where parent_id=#{parentId}")
    int maxSortByParentId(@Param("parentId") String parentId);

}